<template>
  <div>
     <button @click="getRef">获取Header组件上的ref</button>
    <Header ref="HeaderComp"/>
    <hr />
    <Count />
  </div>
</template>

<script>
import Header from "./components/Header";
import Count from "./components/Count";
export default {
  name: "App",
  components: {
    Header,
    Count,
  },
  methods:{
    getRef() {
       console.log(this.$refs);
      console.log(this.$refs.HeaderComp);
    }
  }
};
</script>

<style scoped>
</style>